package cn.js.sip.rat.system.controller;

import cn.js.sip.rat.system.entity.LogInfoEntity;
import cn.js.sip.rat.system.page.TableDataInfo;
import cn.js.sip.rat.system.service.LogService;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @ClassName: cn.js.sip.rat.system.controller
 * @Description: TODO
 * @author: xuxiaoli
 * @Date: 2020-01-07   14:26
 */
@Api("用户管理")
@Controller
@RequestMapping("system/log")
public class LogInfoController {
    private String prefix = "monitor/operlog";
    @Resource(name = "logService")
    private LogService logService;

    @RequiresPermissions("system:log:view")
    @GetMapping()
    public String operlog() {
        return prefix + "/operlog";
    }

    @RequiresPermissions("system:log:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(LogInfoEntity operLog) {
        return logService.query(operLog);
    }
}
